/* 
 * File:   ErrorHttpServlet.h
 * Author: try
 *
 * Created on 2012年4月2日, 下午6:10
 */

#ifndef ERRORHTTPSERVLET_H
#define	ERRORHTTPSERVLET_H

#include "common.h"
#include <evhttp/HttpServlet.h>
namespace Rapid{
    class ErrorHttpServlet : public HttpServlet{
    public:
        ErrorHttpServlet(unsigned short int code, const char* message):code(code), message(message){};
        virtual ~ErrorHttpServlet(){};

        virtual void service(Request& req, Response& resp){
            resp.setStatus(code, message.c_str());
        }

    private:
        unsigned short int code; 
        std::string message;
    };
}
#endif	/* ERRORHTTPSERVLET_H */

